--
-- Author: shunguo.chen
-- Date: 2018-07-13 16:38:18
--
-- AvatarInfo 创建主角角色需要的信息

local fileName = string.getModeName(...)
local ClassRef = class(fileName)

function ClassRef:ctor(data)
	if data then
		self:read(data)
	end

	self.inBattle = false
	self.autoAudio = false
end

-- params = {
--     gender, --性别 [required]
--     raceID, --种族 [required]
--     classID, --职业 [required]
--     hairID, --头部ID（头部除脸之外部分） [required]
--     faceID, --脸部ID [required]
--     hairColorID, --发色 [optional]
--     fashionIDs ,--时装 [optional] {id1,id2,...}

--     mountID,--坐骑 [optional]
--     inBattle , --是否用于战斗
--     autoAudio, --自动播放音乐帧

-- }
function ClassRef:read(data)
	self.gender = data.gender or 1
	self.raceID = data.raceID or 1
	self.classID = data.classID or 1
	self.faceID = data.faceID or 101
	self.hairID = data.hairID or 101
	self.hairColorID = data.hairColorID or 1
	self.fashionIDs = data.fashionIDs or {}

	self.mountID = data.mountID or 0
end

function ClassRef:clone()
    local info = ClassRef.new()
    info:read(self)

    return info
end

return ClassRef